package jmine.tec.web.pages.app;

import static bancosys.tec.utils.db.descriptor.FlatReferenceDatabaseBuilder.ReferenceDatabaseDescriptionType.POSTSCRIPT;
import jmine.tec.executionlog.domain.ExecutionLogBuilder;
import jmine.tec.executionlog.domain.ExecutionLogItemBuilder;
import jmine.tec.executionlog.domain.enumx.ExecutionStatus;

/**
 * Inicia a aplicação de testes do jMine-Tec.
 * 
 * @author lundberg
 */
public class StartTecWebPages {

    public static void main(String[] args) {
        MockApplicationStarter starter = new MockApplicationStarter();
        starter.prepareEnvironment("jmine-tec-web-pages-test.xml", "jmine-tec-web-pages-db.xml", POSTSCRIPT);
        starter.initializeData(new Runnable() {

            public void run() {
                ExecutionLogItemBuilder.anExecutionLogItem()
                        .executionLog(ExecutionLogBuilder.anExecutionLog().status(ExecutionStatus.ALERT).totalItems(10).save())
                        .saveTimes(10);
                ExecutionLogItemBuilder.anExecutionLogItem()
                        .executionLog(ExecutionLogBuilder.anExecutionLog().status(ExecutionStatus.NOT_OK).totalItems(10).save())
                        .saveTimes(10);
                ExecutionLogItemBuilder.anExecutionLogItem()
                        .executionLog(ExecutionLogBuilder.anExecutionLog().status(ExecutionStatus.OK).totalItems(10).save()).saveTimes(10);
                ExecutionLogItemBuilder.anExecutionLogItem()
                        .executionLog(ExecutionLogBuilder.anExecutionLog().status(ExecutionStatus.RUNNING).totalItems(10).save())
                        .saveTimes(5);
            }
        });
        starter.startJetty();
    }
}
